<%@tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@attribute name="item" required="true" type="cn.livingCloud.dto.ArticleDto" %>

<td>
    ${item.title}
</td>
<td>
    <span class="label label-default">${item.createTime}</span>
</td>
<td>
    <c:if test=" ${ not item.lastModifyTime}">
        暂未修改
    </c:if>
    <span class="label label-default">${item.lastModifyTime}</span>
</td>
<td>
    <c:if test="${ not item.publish}">
        <span class="label label-info">未发布</span>
    </c:if>
    <c:if test="${item.publish}">
        <span class="label label-success">发布</span>
    </c:if>
</td>
<td>
    <span class="label label-info">${item.creater.name}</span>
</td>
<td>
    <div class="form-group">
        <form class="form-inline col-sm-9" action="delete.htm" method="post">
            <c:if test="${not item.publish}">
                <button type="button" class="btn btn-success ChangeState" uuid="${item.uuid}"
                        title="${item.title}"
                        publish="true">发布
                </button>
                <input type="hidden" name="uuid" value="${item.uuid}">
            </c:if>
            <c:if test="${item.publish}">
                <button type="button" class="btn btn-warning ChangeState" uuid="${item.uuid}" title="${item.title}"
                        publish="false">取消发布
                </button>
            </c:if>
            <a class="btn btn-warning"
               href="edit.htm?user_id=${item.userId}&uuid=${item.uuid}">编辑</a>
            <input type="hidden" name="uuid" value="${item.uuid}">
            <button class="btn btn-danger" type="submit"
                    onclick="javascript:return confirm('确定删除文章[${item.title}]?');">
                删除
            </button>
            <a href="#" url="display.htm?uuid=${item.uuid}" class="btn btn-success loadModal"
               data-toggle="modal" data-target="#myModal">预览</a>
        </form>

    </div>
</td>


